package com.aliyun.heiyu.common.source;

import com.aliyun.heiyu.common.util.SM4Util;

import javax.security.auth.callback.NameCallback;

public class DbUsernameCallback extends NameCallback {
    private String encryptUsername;
    public DbUsernameCallback(String encryptUsername) {
        super("Username: "); // Meaningless
        this.encryptUsername = encryptUsername;
    }
    @Override
    public String getName() {
        try {
            return SM4Util.decrypt_CBC(encryptUsername);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
